//
//  MyBillingVC.m
//  MyNewProject
//
//  Created by sun on 2019/2/15.
//  Copyright © 2019 sun. All rights reserved.
//

#import "MyBillingVC.h"
#import "BillingDetailVC.h"

#import "XXPageTabView.h"
#import "XXPageTabItemLable.h"
@interface MyBillingVC ()<XXPageTabViewDelegate>
@property (nonatomic, strong) XXPageTabView *pageTabView;

@end

@implementation MyBillingVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.gk_navTitle = @"明细";
    BillingDetailVC *test1 = [BillingDetailVC new];
    test1.myBillVC = FANLIVC;

    BillingDetailVC *test2 = [BillingDetailVC new];
    test2.myBillVC = JIFENVC;

    [self addChildViewController:test1];
    [self addChildViewController:test2];
   
    
    //支持网易云音乐，今日头条，微博等切换栏效果
//    self.pageTabView = [[XXPageTabView alloc] initWithChildControllers:self.childViewControllers childTitles:@[@"贡献金详情",@"积分详情"]];
    self.pageTabView = [[XXPageTabView alloc] initWithChildControllers:self.childViewControllers childTitles:@[@"我的余额", @"保证金"]];
    self.pageTabView.frame = CGRectMake(0, SKTopBar_Height, SCREEN_WIDTH, SCREENH_HEIGHT-SKTopBar_Height);
    self.pageTabView.delegate = self;
    //    self.pageTabView.bodyBounces = NO;
    self.pageTabView.tabSize = CGSizeMake(0, 47);
    self.pageTabView.titleStyle = XXPageTabTitleStyleDefault;
    self.pageTabView.indicatorStyle = XXPageTabIndicatorStyleDefault;
    
    self.pageTabView.maxNumberOfPageItems = 2;
    
    self.pageTabView.tabItemFont = SKFONT_Semibold(15.0);
    
    self.pageTabView.indicatorHeight = 3;
    self.pageTabView.indicatorWidth = 59;
    self.pageTabView.indicatorView.backgroundColor = SKColorWithHex(0x000000); ;

    //    self.pageTabView.tabBackgroundColor = [UIColor yellowColor];
    self.pageTabView.unSelectedColor = SKColorWithHex(0x9999999);
    self.pageTabView.selectedColor = SKColorWithHex(0x444444);
    
    //    self.pageTabView.tabSize = CGSizeMake(self.view.bounds.size.width-30, 0);
    
    self.pageTabView.selectedTabIndex = self.selectedIndex;
    
    [self.view addSubview:self.pageTabView];
    
    self.view.backgroundColor = [UIColor lightGrayColor];
    UIView *view = [[UIView alloc] init];
    view.frame = CGRectMake(0,SKTopBar_Height +47-1,SCREEN_WIDTH,1);
    view.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0];
    [self.view addSubview:view];
}

- (void)pageTabViewDidEndChange {
    NSLog(@"#####%d", self.pageTabView.selectedTabIndex);
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
